<?php
query_posts("post_type=slider&post_status=publish&posts_per_page=-1");
if( have_posts() ):
?>
<!-- SLIDES CONTAINER -->
<div id="slideshow_container"> 
	<div id="top">
		<div id="slideshow">
			<?php
			while ( have_posts() ) : the_post();
			 ?>
			<?php
				$custom = get_post_custom($post->ID);
				$sliderurl = $custom["slider-url"][0];
				$cf_thumb = $custom["thumb"][0];
			?>
			<div class="slideshow_content">
				<?php if(has_post_thumbnail( $the_ID) || $cf_thumb!=""){ ?>
				<div class="slide_image">
					<?php 
						if($cf_thumb!=""){
							echo "<img src='" . $cf_thumb . "' alt=''  width='560' height='240' />";
						}else{
							the_post_thumbnail( 'slider-post-thumbnail' );
						}
					?>
				</div><!-- end of slide image -->
				<?php } ?>
				<div class="slide_text">
				<h1><?php the_title(); ?></h1>
				<?php $excerpt = get_the_excerpt(); echo ts_string_limit_words($excerpt,50);?>
				<?php if($sliderurl!=""){?>
					<a href="<?php echo $sliderurl; ?>" class="slidermore"><?php _e('Read more &raquo;');?></a>
					<?php } ?> 
					
				</div><!-- end of slide text -->
			</div><!-- end of slideshow content -->
			<?php endwhile; ?>
		</div><!-- end of slideshow -->
	</div><!-- end of top -->
</div>
<!-- END OF SLIDES CONTAINER -->
<?php endif; ?>
<?php wp_reset_query();?>
